package com.ifly.task.repository;

import com.ifly.task.pojo.Type;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @program: mypro
 * @description: todo
 * @author: xuYao2
 * @create: 2022-07-22 14:17
 **/
@Repository
public interface TypeRepository extends JpaRepository<Type, Long>, JpaSpecificationExecutor<Type> {
    /**
     * 获取所有的类型名称
     * @return
     */
    @Query(value = "SELECT name FROM type", nativeQuery = true)
    List<String> findAllType();
}
